<%--
  Created by IntelliJ IDEA.
  User: bin.liu
  Date: 2018/12/5
  Time: 16:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<jsp:include page="/pages/sysIndex/default.jsp"/>
<div class="main-content">
    <div class="box box-main">
        <div class="box-header">
            <div class="box-title">
                <i class="fa icon-trophy"></i>审核列表
            </div>
            <div class="box-tools pull-right">
                <a href="#" class="btn btn-default" id="btnSearch" title="查询"><i class="fa fa-filter"></i> 查询</a>
            </div>
        </div>

        <div class="box-body">
            <form id="searchForm" action="<c:url value="/web/admin/taskAuditRecord/listJson.action"/>" method="post" class="form-inline hide" data-page-no="1" data-page-size="20" data-order-by="">
                <div class="form-group">
                    <label class="control-label">工单名称：</label>
                    <div class="control-inline">
                        <input type="text" id="orderName" name="orderName" value="" maxlength="64"
                               class="form-control width-120">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">工单流水号：</label>
                    <div class="control-inline">
                        <input type="text" id="serial" name="serial" value="" maxlength="64"
                               class="form-control width-120">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">审核时间：</label>
                    <div class="control-inline">
                        <input type="text" id="startTime" name="startTime" value="" maxlength="64"
                               class="form-control Wdate" autoComplete="off" style="width: 200px">--
                        <input type="text" id="endTime" name="endTime" value="" maxlength="64"
                               class="form-control Wdate" autoComplete="off" style="width: 200px">
                    </div>
                </div>

                <div class="form-group">
                    <button type="submit" class="btn btn-primary btn-sm">查询</button>
                    <button type="reset" class="btn btn-default btn-sm">重置</button>
                </div>
            </form>

            <table id="dataGrid"></table>
            <div id="dataGridPage"></div>
        </div>

    </div>
</div>
<script>
    $('#dataGrid').dataGrid({
        searchForm: $("#searchForm"),
        columnModel: [
            {header:'工单名称', name:'orderName', index:'orderName', width:150, align:"center",sortable: false},
            {header:'工单号', name:'serial', index:'serial', width:150, align:"center",sortable: false},
            {header:'审核人',name: 'auditUser', index: 'auditUser', width: 150, align: "center",sortable: false},
            {header:'审核时间',name: 'auditDate', index: 'auditDate', width: 150, align: "center",sortable: false},
            {header:'是否通过',name: 'pass', index: 'pass', width: 150, align: "center",sortable: false},
            {header:'原因',name: 'reason', index: 'reason', width: 150, align: "center",sortable: false},
            {header:'备注',name: 'remark', index: 'remark', width: 150, align: "center",sortable: false},
            {header:'审核等级',name: 'level', index: 'level', width: 150, align: "center",sortable: false},
            {header:'所属企业', name:'enterpriseName', index:'enterprise', width:150, align:"center",sortable: false},
            <%--{--%>
                <%--header: '操作',--%>
                <%--name: 'actions',--%>
                <%--width: 100,--%>
                <%--sortable: false,--%>
                <%--title: false,--%>
                <%--formatter: function (val, obj, row, act) {--%>
                    <%--var editUrl='<c:url value="/web/admin/auditOrder/editPage.action?id="/>'+row.id;--%>
                    <%--return '<a href="javascript:;" class="btn btn-default btn-xs btnList" onclick="vLayuiUtil.openLayerWindow(\'wAuditOrder\', \''+editUrl+'\',\'编辑\')"><i class="fa fa-pencil">编辑</i></a>&nbsp;';--%>
                <%--}--%>
            <%--}--%>

        ],
        // 加载成功后执行事件
        ajaxSuccess: function(data){

        }
    });

    $("#startTime").datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        minuteStep:1,
        autoclose:true,//选中关闭
        todayBtn: true//今日按钮
    });
    $("#endTime").datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        minuteStep:1,
        autoclose:true,//选中关闭
        todayBtn: true//今日按钮
    });

    // 时间选择器互动（结束时间不得早于开始时间）
    $("#startTime").on('changeDate', function(ev) {
        $("#endTime").datetimepicker('setStartDate', ev.date);
        var d = $("#endTime").val();
        if (d) {
            var date = new Date(d.replace(/-/g, '/'));
            if (date != 'Invalid Date' && date < ev.date) {
                $("#endTime").datetimepicker('setDate', ev.date)
            }
        }
    });
</script>
